import { request } from '@/framework/utils/request-jdz';

// 查询全部未分享的数据
export const getUnSharedData = (params: API.SharedDataType) => {
  return request(
    {
      url: '/spec/unshared',
      method: 'get',
      params,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
// 查询全部已分享数据
export const getSharedData = (params: API.SharedDataType) => {
  return request(
    {
      url: '/spec/shared',
      method: 'get',
      params,
    },
    {
      isGetDataDirectly: false,
    },
  );
};

// 添加到我的收藏
export const getAddMyCollection = (params) => {
  return request(
    {
      url: '/spec/spec/store',
      method: 'post',
      data: params,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
// 将样本标记共享
export const putSampleSharing = (params) => {
  return request(
    {
      url: '/spec/shared',
      method: 'put',
      data: params,
    },
    {
      isGetDataDirectly: false,
    },
  );
};

// 取消样本共享
export const putSampleUnSharing = (params) => {
  return request(
    {
      url: '/spec/unshared',
      method: 'put',
      data: params,
    },
    {
      isGetDataDirectly: false,
    },
  );
};

// 审批单保存
export const postSaveApproval = (params) => {
  return request(
    {
      url: '/spec/bill/save',
      method: 'post',
      data: params,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
// 获取审批单名称
export const getApprovalName = () => {
  return request(
    {
      url: '/spec/bill/name',
      method: 'post',
    },
    {
      isGetDataDirectly: false,
    },
  );
};
// 获取审批单单号
export const getApprovalCode = () => {
  return request(
    {
      url: '/spec/bill/batchNo',
      method: 'post',
    },
    {
      isGetDataDirectly: false,
    },
  );
};
